package com.go10.catalog.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.go10.catalog.common.ServiceMessage;
import com.go10.catalog.pojo.Catalog;
import com.go10.catalog.service.CatalogService;

@Controller
@RequestMapping("/go10/catalog")
public class CatalogController {
@Autowired
private CatalogService service;
@GetMapping("/${pid}")
public ServiceMessage getpid(@PathVariable Long pid)
{
	try {
		List<Catalog> list = service.getByPid(pid);
	  return  ServiceMessage.ok(list);
	} catch (Exception e) {
	
		return ServiceMessage.error();
	}
	
}
}
